package experiment5.task;

import java.sql.Timestamp;
import java.util.Date;

/**
 * @author:fyl
 * @date 2021/5/21 20:42
 * @Modified By:
 * @Modified Date:
 * @Description:
 */
public class Message {
    private int id;
    private int sid;
    private String sname;
    private int rid;
    private String rname;
    private String message;
    private Timestamp time;

    public Message() {
    }

    public Message( int sid, String sname, int rid, String rname, String message, Date time) {
        this.sid = sid;
        this.sname = sname;
        this.rid = rid;
        this.rname = rname;
        this.message = message;
        this.time = (Timestamp) time;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getSid() {
        return sid;
    }

    public void setSid(int sid) {
        this.sid = sid;
    }

    public String getSname() {
        return sname;
    }

    public void setSname(String sname) {
        this.sname = sname;
    }

    public int getRid() {
        return rid;
    }

    public void setRid(int rid) {
        this.rid = rid;
    }

    public String getRname() {
        return rname;
    }

    public void setRname(String rname) {
        this.rname = rname;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Timestamp getTime() {
        return time;
    }

    public void setTime(Timestamp  time) {
        this.time = time;
    }

    @Override
    public String toString() {
        return "Message{" +
                "id=" + id +
                ", sid=" + sid +
                ", sname='" + sname + '\'' +
                ", rid=" + rid +
                ", rname='" + rname + '\'' +
                ", message='" + message + '\'' +
                ", time =" + time +
                '}';
    }
}
